import os
import sys
import string
from unit_test import runUnitTests
sys.path.append('%s/library' % (Dir('#').abspath))

Import('mainEnv', 'testEnv')
Import('mcoreLibrary', 'pmallocLibrary', 'mtmLibrary')
configEnv = mainEnv.Clone()
myTestEnv = testEnv.Clone()


test = myTestEnv.Program('test', source = [Glob('*.tests.cxx'), Glob('*.fixtures.cxx'), Glob('*.helpers.cxx'), 'main.cxx'], LIBS=['UnitTest++', mcoreLibrary])
runtests = myTestEnv.Command("test.passed", ['test', mcoreLibrary, pmallocLibrary, mtmLibrary], runUnitTests)

#myTestEnv.addUnitTest({'MCORE_RESET_SEGMENTS': '1'}, test[0].path, '-i 0')
#myTestEnv.addUnitTest({'MCORE_RESET_SEGMENTS': '0'}, test[0].path, '-i 1')
#myTestEnv.addUnitTest({'MCORE_RESET_SEGMENTS': '0'}, test[0].path, '-i 2')
